/**
 * 重写数组删除方法
 * @param val
 */
Array.prototype.removeByValue = function (val) {
    for (var i = 0; i < this.length; i++) {
        if (this[i].staffId == val) {
            this.splice(i, 1);
            break;
        }
    }
}


var arr = [];

function choseStaff(va) {

    var staff = {};

    staff.staffId = $(va).val();
    staff.staffName = $(va).attr("lang");

    if ($(va).is(":checked") == true) {

        arr.push(staff);
    }
    else {
        arr.removeByValue($(va).val());
    }


    var tt = Handlebars.compile($('#hasChoseStaff').text())(
        {list: arr});


    $('#hasChose').html(tt);
}


function doSubmit() {
	WEB.msg.info("提示","分配成功",function(){
                    window.location.href = "roleList.html";
                });
    return;

}


function goBack()
{
    window.location.href = "roleList.html";
}


$(function () {

});